export type PlayerCategory =
  | "overall"
  | "combat"
  | "crystal"
  | "heart"
  | "potion"
  | "discord"
  | "circle"
  | "sword"
  | "axe"
  | "hammer"

export type SkillTier = 
  | "HT1" | "LT1" | "HT2" | "LT2" | "HT3" | "LT3" | "HT4" | "LT4" | "HT5" | "LT5"
  | "SWORD" | "CRYSTAL" | "BUHC" | "POTION" | "NPOT" | "SMP";

export type GameMode = {
  mode: SkillTier;
  score: number;
};

export interface PlayerTitle {
  name: string
  color: string
  points: number
  icon?: string
  description?: string
}

export interface Player {
  id: string
  name: string
  scores: Score[]
  createdAt: string
  title?: { name: string; color: string; points: number; icon?: string; description?: string }
  avatar?: string
  rank?: number
  score?: number
  region?: string
  tier?: string
  tierMode?: string
  overallRank?: number
  overallScore?: number
  swordTier?: number | null
  crystalTier?: number | null
  buhcTier?: number | null
  potionTier?: number | null
  npotTier?: number | null
  smpTier?: number | null
  swordTierName?: string
  crystalTierName?: string
  buhcTierName?: string
  potionTierName?: string
  npotTierName?: string
  smpTierName?: string
  bestTier?: number | null
  bestTierName?: string
  bestTierMode?: string
  skills?: Skill[]
  playTime?: number
  currentTiers?: any[]
  retiredTiers?: any[]
}

export interface Score {
  id: number
  mode: string
  value: number
  createdAt: string
  playerId: number
}

export interface Skill {
  name: string
  tier: SkillTier
  points: number
}

export interface CategoryIcon {
  category: PlayerCategory
  icon: React.ReactNode
  color: string
  label?: string
}

// API响应类型
export interface PlayerResponse {
  id: number
  name: string
  avatar: string
  region: string
  scores: Score[]
  isAdmin: boolean
  swordTier: number | null
  crystalTier: number | null
  buhcTier: number | null
  potionTier: number | null
  npotTier: number | null
  smpTier: number | null
  createdAt: string
}

export interface RankingResponse {
  id: number
  name: string
  avatar: string
  region: string
  score: number
  tier?: number | null
  swordTier?: number | null
  crystalTier?: number | null
  buhcTier?: number | null
  potionTier?: number | null
  npotTier?: number | null
  smpTier?: number | null
}
